package cn.lite3.soundPlayer.core 
{
	import cn.lite3.soundPlayer.events.CoreEventDispatcher;
	import cn.lite3.soundPlayer.events.SoundTransformEvent;
	import flash.media.SoundTransform;
	/**
	 * ...
	 * @author lite3
	 */
	public class SondTransformControl extends SoundTransform
	{
		
		public function SondTransformControl()
		{
			super();
		}
		
		public function setSoundTransform(st:SoundTransform):void
		{
			super.leftToLeft = st.leftToLeft;
			super.leftToRight = st.leftToRight;
			super.rightToLeft = st.rightToLeft;
			super.rightToRight = st.rightToRight;
			super.pan = st.pan;
			super.volume = super.volume;
			
			dispatchEvent();
		}
		
		override public function set leftToLeft(value:Number):void 
		{
			super.leftToLeft = value;
			dispatchEvent();
		}
		
		override public function set leftToRight(value:Number):void 
		{
			super.leftToRight = value;
			dispatchEvent();
		}
		
		override public function set rightToLeft(value:Number):void 
		{
			super.rightToLeft = value;
			dispatchEvent();
		}
		
		override public function set rightToRight(value:Number):void 
		{
			super.rightToRight = value;
			dispatchEvent();
		}
		
		override public function set volume(value:Number):void 
		{
			super.volume = value;
			dispatchEvent();
		}
		
		override public function set pan(value:Number):void 
		{
			super.pan = value;
			dispatchEvent();
		}
		
		private function dispatchEvent():void
		{
			var evt:SoundTransformEvent = new SoundTransformEvent(SoundTransformEvent.CHANGE, false, false, this);
			CoreEventDispatcher.dispatcher.dispatchEvent(evt);
		}
	}
}